import React, { lazy } from 'react'
import { routerItem } from '../interface'
//一级路由
const Login = lazy(() => import('../page/Login'))
const Home = lazy(() => import('../page/Home'))
const SigIn = lazy(() => import('../page/SigIn'))

//二级路由
const System = lazy(() => import('../page/Home/System'))

export const page: routerItem[] = [{
    path: '/home/system',
    name: '系统',
    element: <System></System>,
    auth: '101'
}]

export const routers = [{
    path: '/home',
    element: <Home></Home>,
    name: '主页',
    children: page
}, {
    path: '/login',
    element: <Login></Login>,
    name: '登录'
}, {
    path: '/sigin',
    element: <SigIn></SigIn>,
    name: '注册'
}, {
    form: '/',
    to: '/home/system'
}]

export default routers